
import tensorflow as tf

# and should set environment variable CUDA_VISIBLE_DEVICES=""
with tf.Session() as ses:
    with tf.device("/cpu:0"):
        matrix1=tf.constant([[3.,3.]])
        matrix2=tf.constant([[2.],[2.]])
        product=tf.matmul(matrix1,matrix2)
        ses.run(product)
